/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.io.FileInputStream;
import java.util.Random;

/**
 * <p>Project: jse2303 - Demo
 * <p>Powered by webrx On 2023-07-10 17:40:49
 * <p>描述：<p>
 *
 * @author webrx 手机号：13014577066 [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Demo {
    public static void main(String[] args) {
        Random rand = new Random();
        for (int i = 0; i < 18; i++) {
            //System.out.println(rand.nextInt(5)); //0 1 2 不包括3
            System.out.println(rand.nextInt(11) + 1); //0-11
        }

        //读取ascii文件 文本文件（字符串字符文件）
        System.out.println("读取文件：");
        try (FileInputStream is = new FileInputStream("user.txt")) {
            byte[] buf = new byte[is.available()];
            is.read(buf);
            String txt = new String(buf);
            System.out.println(txt);
        } catch (Exception e) {

        }
    }
}
